import os

_mode = os.environ.get("MOOETOOL_PCD_VIEWER", "vispy").strip().lower()

PCDViewerWindow = None  # type: ignore

if _mode == "vispy":
    try:
        from .pcd_viewer_vispy import PCDViewerWindow as _PCDVispyWindow
        PCDViewerWindow = _PCDVispyWindow  # type: ignore
    except Exception:
        from .pcd_viewer import PCDViewerWindow as _PCDGLWindow
        PCDViewerWindow = _PCDGLWindow  # type: ignore
else:
    try:
        from .pcd_viewer import PCDViewerWindow as _PCDGLWindow
        PCDViewerWindow = _PCDGLWindow  # type: ignore
    except Exception:
        from .pcd_viewer_vispy import PCDViewerWindow as _PCDVispyWindow
        PCDViewerWindow = _PCDVispyWindow  # type: ignore

__all__ = ["PCDViewerWindow"]
